package cn.tianjindong.blog.pojo;

import java.text.SimpleDateFormat;
import java.util.Date;

public class BlogVisitlog {
	private Long id;

	private Long userId;

	private Date visitTime;

	private String ipaddress;

	private String mac;

	private BlogUser user;

	private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public BlogUser getUser() {
		return user;
	}

	public void setUser(BlogUser user) {
		this.user = user;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public Date getVisitTime() {
		return visitTime;
	}

	public void setVisitTime(Date visitTime) {
		this.visitTime = visitTime;
	}

	public String getIpaddress() {
		return ipaddress;
	}

	public void setIpaddress(String ipaddress) {
		this.ipaddress = ipaddress == null ? null : ipaddress.trim();
	}

	public String getMac() {
		return mac;
	}

	public void setMac(String mac) {
		this.mac = mac == null ? null : mac.trim();
	}

	/**
	 * 获取时间字符串
	 * 
	 * @return
	 */
	public String getStringVisittime() {
		if (this.visitTime != null) {
			String dateStr = dateFormat.format(visitTime);
			return dateStr;
		}
		return null;
	}
}